package com.nbsaas.boot.pms.data.entity;

import com.nbsaas.boot.code.annotation.*;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Data;
import org.hibernate.annotations.Comment;

import java.util.Date;

@CreateByUser
@ComposeView
@Data
@FormAnnotation(title = "项目风险", model = "项目风险")
@Entity
@Table(name = "bs_pms_project_risk")
@Comment("项目风险表")
public class ProjectRisk extends AbstractEntity {

    @Comment("风险名称")
    @SearchItem(name = "name", key = "name", label = "风险名称")
    @FormField(title = "风险名称", sortNum = "1", grid = true, required = true)
    @Column(length = 200, nullable = false)
    private String name;

    @Comment("项目ID")
    @FormField(title = "所属项目", sortNum = "2", grid = true, type = InputType.select)
    private Long projectId;

    @Comment("风险描述")
    @FormField(title = "风险描述", sortNum = "3", type = InputType.textarea, col = 23)
    @Column(columnDefinition = "TEXT")
    private String description;

    @Comment("风险类型")
    @FormField(title = "风险类型", sortNum = "4", grid = true, type = InputType.select)
    @Column(length = 20)
    private String type;

    @Comment("风险等级")
    @FormField(title = "风险等级", sortNum = "5", grid = true, type = InputType.select)
    @Column(length = 20)
    private String level;

    @Comment("风险状态")
    @FormField(title = "风险状态", sortNum = "6", grid = true, type = InputType.select)
    @Column(length = 20)
    private String status;

    @Comment("负责人ID")
    @FormField(title = "负责人", sortNum = "7", grid = true, type = InputType.select)
    private Long ownerId;

    @Comment("识别日期")
    @FormField(title = "识别日期", sortNum = "8", type = InputType.date, grid = true)
    private Date identifiedDate;

    @Comment("缓解措施")
    @FormField(title = "缓解措施", sortNum = "9", type = InputType.textarea, col = 23)
    @Column(columnDefinition = "TEXT")
    private String mitigationPlan;

    @Comment("备注")
    @FormField(title = "备注", sortNum = "10", type = InputType.textarea, col = 23)
    @Column(columnDefinition = "TEXT")
    private String remarks;
} 